# 列表推导式，求列表中偶数的平方值
list1 = [i ** 2 for i in range(1, 11) if i % 2 == 0]

# 元组推导式，求列表中偶数的平方值
tuple1 = (i ** 2 for i in range(1, 11) if i % 2 == 0)

# 集合推导式，求列表中偶数的平方值
squared = {x ** 2 for x in [1, 1, 2]}

# 字典推导式
dict1 = {'a': 10, 'b': 34, 'A': 7, 'Z': 3}
# value清零
zero_dict1 = {v: 0 for v in dict1}

# 交换key和value
exchange = {v: k for k, v in dict1.items()}
